package com.llb666.e.shop.api.vo;

import com.llb666.e.shop.domain.entity.es.EsItems;
import lombok.Data;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

/**
 * 用于展示商品搜索列表结果的 VO.
 *
 * @author llb666
 */
@Data
public class SearchItemsVo {


    /**
     * 商品Id
     */
    private String itemId;

    /**
     * 商品名
     */
    private String itemName;

    /**
     * 销量
     */
    private Integer sellCounts;

    /**
     * 图片Url
     */
    private String imgUrl;

    /**
     * 价格
     */
    private Integer price;

    @Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
    public interface Converter {
        SearchItemsVo.Converter INSTANCE = Mappers.getMapper(SearchItemsVo.Converter.class);

        SearchItemsVo do2Vo(EsItems activity);

    }
}
